package com.itheima.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.itheima.dto.AdaptationParameterDTO;
import com.itheima.ship.po.AdaptationParameter;
import com.itheima.mapper.AdaptationParameterMapper;
import com.itheima.service.IAdaptationParameterService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 郑哥
 * @since 2024-05-19
 */
@Service
public class AdaptationParameterServiceImpl extends ServiceImpl<AdaptationParameterMapper, AdaptationParameter> implements IAdaptationParameterService {


    @Override
    public void add(AdaptationParameterDTO adaptationParameterDTO) {
        //之后拿到无人船数据后再修改
        adaptationParameterDTO.setCollectionTime(LocalDateTime.now());
        AdaptationParameter adaptationParameter = BeanUtil.copyProperties(adaptationParameterDTO, AdaptationParameter.class);
        this.save(adaptationParameter);
    }
}
